From: | Nick Clover |
Date: | 22 May 2001 at 23:20:35 |
Subject: | Re: PROGDIR: |
Hello Daniel
On 22-May-01, you wrote:
> I have silly question but how I can read my progdir: path in Blitz?
> Kind Redgards
> Daniel
Use My bit of code from Stats&Funcs:
; Function : ProgsDir {}
; Author : Nick Clover - nick@bauk.freeserve.co.uk
; Returns a string with the program's directory.
; IMPORTANT! Only works with compiled executables,as
; Compiling & Running doesn't use a directory (obviously ;)
; **** REPLACEMENT by Nick Clover ****
; Now returns program directory when run from WB as well!
; Cool :)
; UPDATE - renamed to ProgsDir, to keep in line with ProgsName,
; because ProgDir is a BLITZ Support Suite command.
Function.s ProgsDir{}
MaxLen path$=200
NameFromLock_ GetProgramDir_(),&path$,200
path$=Peek$(&path$)
If Right$(path$,1)<>":" AND Right$(path$,1)<>"/"
path$+"/"
EndIf
If path$="SYS:" Then path$="I only work when compiled!"
Function Return path$
End Function
; demo :
;; note that this returns a name only from executables!
;; you'll just get a blank string if you run it from Blitz!
; Request "","Path : "+ProgsDir{},"OK"
; End
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list/-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list/-help@netsoc.ucd.ie